import request from '@/utils/request'

// 查询合同模板修改申请列表
export function templateApplyList(query) {
  return request({
    url: '/contractTemplate/contractTemplateApply/list',
    method: 'get',
    params: query
  })
}

// 获取合同模板修改申请详细信息
export function templateApplyDetails(id) {
    return request({
        url: `/contractTemplate/contractTemplateApply/${id}`,
        method: 'get'
    })
}

// 新增合同模板修改申请
export function templateApplyAdd(data) {
  return request({
    url: '/contractTemplate/contractTemplateApply',
    method: 'post',
    data:data
  })
}

// 其他生效模板
export function otherOptionalTemplates(query) {
    return request({
        url: '/contractTemplate/contractTemplate/optionalTemplates',
        method: 'get',
        params: query
    })
}

// 公司标准模板
export function getCompanyStandards(query) {
    return request({
        url: '/contractTemplate/contractTemplate/getCompanyStandards',
        method: 'get',
        params: query
    })
}

// 启用失效模板
export function enablingOptionalTemplates(query) {
    return request({
        url: '/contractTemplate/contractTemplate/optionalTemplates',
        method: 'get',
        params: query
    })
}

//管理客户
export function contractTemplateApplyManageCustomers(data) {
    return request({
        url: '/contractTemplate/contractTemplateApply/manageCustomers',
        method: 'post',
        data:data
    })
}

// 获取合同模板内容
export function getContractContent(id) {
    return request({
        url: `/contractTemplate/contractTemplate/getContractContent/${id}`,
        method: 'get'
    })
}

// 下载合同模板内容
export function downloadContractContent(id) {
    return request({
        url: `/contractTemplate/contractTemplate/downloadContractContent/${id}`,
        method: 'get'
    })
}
export const downloadContractTemplate = `contractTemplate/contractTemplate/downloadContractContent`
// 额度列表
export function quotaCalcSchemeList(query) {
    return request({
        url: '/quota/quotaCalcScheme/list',
        method: 'get',
        params: query
    })
}

// 审批记录
export function getFlowRecord(id) {
    return request({
        url: `/contractTemplate/contractTemplateApply/getFlowRecord/${id}`,
        method: 'get'
    })
}
